<?php
class Admin_user_model extends CI_Model{
	
	var $table = "users";
    public $users_groups = 'users_groups';    
	var $table_address_book = "address_book";
    public $memcache;
    
    public function __contruct(){
        parent::__construct();
    }
    
    public function get_list_user($start , $limit){  
        $query = "SELECT u.id , u.email , u.created_on , u.last_login , u.active , u.avatar , u.full_name , u.phone , ug.group_id 
                FROM $this->table u
                LEFT JOIN $this->users_groups ug ON ug.user_id = u.id" ;     
        $limit = " LIMIT $start , $limit";
        return array(
            'rows' => $this->db->query($query . $limit)->result_array() , 
            'total' => $this->db->query($query)->num_rows()
        );
        
    }
    
}